﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Templay;
using System.Diagnostics;
using System.IO;

namespace Sample3
{
    class Program
    {
        static void Main(string[] args)
        {
            Stopwatch sw = new Stopwatch();
            sw.Start();

            Template<XmlParser> template = new Template<XmlParser>();
            template.Render("Templates\\Sample3.xml", OpenMode.FILE, new Func<string, string>(TemplateEngine));
            template.Run();

            sw.Stop();

            Console.ReadKey();
        }

        private static string TemplateEngine(string template)
        {
            Data data = new Data() { A = "hello", B = "world" };
            DotLiquid.Template templateEngine = DotLiquid.Template.Parse(template);
            return templateEngine.Render(DotLiquid.Hash.FromAnonymousObject(new { data }));
        }

    }
}
